Rules for multiplication of matrices